package com.funkids.rabbitmq;

import com.alibaba.fastjson.JSON;
import com.funkids.common.dto.SeckillOrderMq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;


@Slf4j
@Service
public class RMSender {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(Object msg){
        log.info("发送消息："+msg);
        rabbitTemplate.convertAndSend("queue",msg);
    }

    public void sendSeckillInfo(String seckillOrderMq){
        log.info("发送消息："+seckillOrderMq);
        rabbitTemplate.convertAndSend("exchangeT","seckill.message",seckillOrderMq);
    }


}
